<template>
  <a-card :bordered="false">
    <a-table
      ref="table"
      size="middle"
      bordered
      :rowKey="rowKey"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: (radio ? 'radio' : 'checkbox')}"
      @change="handleTableChange"
      :customRow="clickThenCheck">
    </a-table>
  </a-card>
</template>

<script>

import {YcListMixin} from '@/mixins/YcListMixin'
import YchConstant from "@/api/YchConstant";

export default {
  name: 'SelectRelationPositionList',
  mixins: [YcListMixin],
  props: {
    radio: Boolean,
  },
  data() {
    return {
      columns: [
        {
          title: this.$t('m.system.position.entity.positionName'),
          align: 'center',
          dataIndex: 'name'
        },
        {
          title: this.$t('m.system.position.entity.positionCode'),
          align: 'center',
          dataIndex: 'positionCode'
        },
      ],
      url: {
        list: YchConstant.PREFIX_BPM + '/bpm-back/processSelectRest/getPositionListByPage/v1',
      }
    }
  },
  methods: {}
}
</script>
